import AxiosApi from '@/api/AxiosApi'
import type { IResult } from '@/interfaces/IApi'
export async function getMenu(): Promise<IResult> {
  const result = await AxiosApi.get('/auth/list')
  console.log(result)
  return result.data
}

export async function getCityMenu(): Promise<Record<string, Record<string, string>>> {
  const result = await AxiosApi.get('/city')
  return result.data
}

export async function uploadFile(arr: ArrayBuffer, sliceCount: number) {
  const result = await AxiosApi.post('/file/upload', arr, {
    headers: { 'X-Slice-Count': sliceCount },
  })
  return result.data
}

export async function uploadFinish(fileName: string, md5: string) {
  const result = await AxiosApi.post('/file/finish', { fileName, md5 })
  return result.data
}
